

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/fluid.png">
  <link rel="icon" href="/img/fluid.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="Moe Wang">
  <meta name="keywords" content="">
  
    <meta name="description" content="前言我们在地图相关系统中必不可少的就是空间分析操作相关需求，例如缓冲区、计算等高线等。凭借简单的js我们无法将点线面进行结合分析，而Turf.js的出现帮我们解决了这一难题，让我们在浏览器中也可以轻松的使用以前只属于桌面GIS的分析功能。 Turf.js简介及其意义Turf.js是MapBox公司研发的基于浏览器端的空间分析库，它使用JavaScript进行编写，通过npm进行包管理。值得一提的是">
<meta property="og:type" content="article">
<meta property="og:title" content="Turf.js—让你在浏览器上实现地理分析">
<meta property="og:url" content="https://moewang0321.github.io/2021/06/01/Turf.js%E2%80%94%E8%AE%A9%E4%BD%A0%E5%9C%A8%E6%B5%8F%E8%A7%88%E5%99%A8%E4%B8%8A%E5%AE%9E%E7%8E%B0%E5%9C%B0%E7%90%86%E5%88%86%E6%9E%90/index.html">
<meta property="og:site_name" content="moe_大杂烩">
<meta property="og:description" content="前言我们在地图相关系统中必不可少的就是空间分析操作相关需求，例如缓冲区、计算等高线等。凭借简单的js我们无法将点线面进行结合分析，而Turf.js的出现帮我们解决了这一难题，让我们在浏览器中也可以轻松的使用以前只属于桌面GIS的分析功能。 Turf.js简介及其意义Turf.js是MapBox公司研发的基于浏览器端的空间分析库，它使用JavaScript进行编写，通过npm进行包管理。值得一提的是">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/e425077a384a4c5a9d942a0899e09367~tplv-k3u1fbpfcp-watermark.image">
<meta property="og:image" content="https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/6a7db45453f044f983729f314cba06d7~tplv-k3u1fbpfcp-watermark.image">
<meta property="og:image" content="https://p9-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/a01bb688c6f74483a33a52aa505a5ec1~tplv-k3u1fbpfcp-watermark.image">
<meta property="og:image" content="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ea6705e11a7c4529a5fef7e5e1f09177~tplv-k3u1fbpfcp-watermark.image">
<meta property="og:image" content="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/5aab8d3e07a14080a2062f5c8f7b2700~tplv-k3u1fbpfcp-watermark.image">
<meta property="og:image" content="https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/285a8c794fb1488e810682ae96929526~tplv-k3u1fbpfcp-watermark.image">
<meta property="og:image" content="https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/c98c804ab1c84b7a9393477adac8cf52~tplv-k3u1fbpfcp-watermark.image">
<meta property="article:published_time" content="2021-06-01T01:11:22.000Z">
<meta property="article:modified_time" content="2023-02-14T08:24:49.864Z">
<meta property="article:author" content="Moe Wang">
<meta property="article:tag" content="JavaScript">
<meta property="article:tag" content="GIS">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/e425077a384a4c5a9d942a0899e09367~tplv-k3u1fbpfcp-watermark.image">
  
  
  
  <title>Turf.js—让你在浏览器上实现地理分析 - moe_大杂烩</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
  




  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"moewang0321.github.io","root":"/","version":"1.9.4","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml"};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
  


  
<meta name="generator" content="Hexo 5.4.2"></head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 70vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>moe_大杂烩</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                <span>首页</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                <span>归档</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                <span>分类</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                <span>标签</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                <span>关于</span>
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              <i class="iconfont icon-search"></i>
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">
              <i class="iconfont icon-dark" id="color-toggle-icon"></i>
            </a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('/img/default.png') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="Turf.js—让你在浏览器上实现地理分析"></span>
          
        </div>

        
          
  <div class="mt-3">
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2021-06-01 09:11" pubdate>
          2021年6月1日 上午
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          5.3k 字
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          44 分钟
        
      </span>
    

    
    
  </div>


        
      </div>

      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      

    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">Turf.js—让你在浏览器上实现地理分析</h1>
            
            
              <div class="markdown-body">
                
                <h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p>我们在地图相关系统中必不可少的就是空间分析操作相关需求，例如缓冲区、计算等高线等。凭借简单的js我们无法将点线面进行结合分析，而<code>Turf.js</code>的出现帮我们解决了这一难题，让我们在浏览器中也可以轻松的使用以前只属于桌面GIS的分析功能。</p>
<h2 id="Turf-js简介及其意义"><a href="#Turf-js简介及其意义" class="headerlink" title="Turf.js简介及其意义"></a>Turf.js简介及其意义</h2><p>Turf.js是MapBox公司研发的基于浏览器端的空间分析库，它使用JavaScript进行编写，通过npm进行包管理。值得一提的是，良好的模块化设计使其不仅能够作用于浏览器端、还可通过Node.js在服务端使用。Turf 原生支持 GeoJSON 矢量数据。GeoJSON 的优点是结构简单，并且得到了所有网页地图API的支持；但 GeoJSON 不支持空间索引，这个缺点可能会限制 Turf 处理大型文件的能力效率。其适用于轻量级（数据轻量而非功能轻量）的WebGIS应用。</p>
<p>浏览器端支持空间分析的意义在于，通过网页地图的不仅可提供地名搜索与路径查询（目前 Google Maps 的功能其实与十年前并没有太大区别），而且可以在浏览器中分享空间分析模型。以前的 WebGIS 功能当然也支持空间分析，但是分析过程需要在服务器端进行，本地能够进行的设置有限，现在使用 Turf.js 可以将分析过程完全移到本地，如果页面中提供了参数设置的话，可以在本地对模型进行修改并立即看到分析结果。这样的直接好处有两个方面：更渲的数据展示，以及更加复杂的用户交互（复杂交互本身需要空间分析作为基础）。</p>
<h2 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h2><p>引入全部功能</p>
<figure class="highlight aspectj"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs aspectj"><span class="hljs-comment">// 下载</span><br>$ npm install <span class="hljs-meta">@turf</span>/turf<br></code></pre></td></tr></table></figure>

<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs js"><span class="hljs-comment">// 引入</span><br><span class="hljs-keyword">import</span> * <span class="hljs-keyword">as</span> turf <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;@turf/turf&#x27;</span><br><span class="hljs-keyword">import</span> &#123; lineString, along &#125; <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;@turf/turf&#x27;</span><br></code></pre></td></tr></table></figure>

<p>如果想引用指定模块，可以下载功能名称对应的npm包（功能名称对应其包的名称）</p>
<figure class="highlight coffeescript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs coffeescript">$ <span class="hljs-built_in">npm</span> install @turf/collect<br></code></pre></td></tr></table></figure>

<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs js"><span class="hljs-keyword">import</span> collect <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;@turf/collect&#x27;</span>;<br></code></pre></td></tr></table></figure>

<h2 id="功能"><a href="#功能" class="headerlink" title="功能"></a>功能</h2><p>Turf 有着质量极高的<a target="_blank" rel="noopener" href="http://turfjs.org/examples/turf-within/">官方文档</a>，详细介绍了每个功能模块的使用，并有在线示例可以直接上手试用。</p>
<p>Turf的功能分为几大类，我们列举几个常用类并抽出一两个常用方法做展示。</p>
<h3 id="MEASUREMENT"><a href="#MEASUREMENT" class="headerlink" title="MEASUREMENT"></a>MEASUREMENT</h3><h4 id="area（计算区域面积）"><a href="#area（计算区域面积）" class="headerlink" title="area（计算区域面积）"></a>area（计算区域面积）</h4><blockquote>
<p>获取一个或多个<code>feature</code>，并返回其面积平方米。</p>
</blockquote>
<p><strong>参数</strong></p>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">类型</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left">geojson</td>
<td align="left">GeoJSON</td>
<td align="left">input GeoJSON feature(s)</td>
</tr>
</tbody></table>
<p><strong>返回</strong></p>
<p>number - area in square meters</p>
<p><strong>示例</strong></p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs js"><span class="hljs-keyword">var</span> polygon = turf.<span class="hljs-title function_">polygon</span>([[<br>        [<span class="hljs-number">108.09876</span>, <span class="hljs-number">37.200787</span>],<br>        [<span class="hljs-number">106.398901</span>, <span class="hljs-number">33.648651</span>],<br>        [<span class="hljs-number">114.972103</span>, <span class="hljs-number">33.340483</span>],<br>        [<span class="hljs-number">113.715685</span>, <span class="hljs-number">37.845557</span>],<br>        [<span class="hljs-number">108.09876</span>, <span class="hljs-number">37.200787</span>]<br>      ]]);<br><br><span class="hljs-keyword">var</span> area = turf.<span class="hljs-title function_">area</span>(polygon);<br></code></pre></td></tr></table></figure>

<p><code>npm install @turf/area</code></p>
<p><img src="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/e425077a384a4c5a9d942a0899e09367~tplv-k3u1fbpfcp-watermark.image" srcset="/img/loading.gif" lazyload alt="image-20210531171407541.png"></p>
<h4 id="centerOfMass（计算多边形质心）"><a href="#centerOfMass（计算多边形质心）" class="headerlink" title="centerOfMass（计算多边形质心）"></a>centerOfMass（计算多边形质心）</h4><blockquote>
<p>取任何<code>Feature</code>或<code>FeatureCollection</code>，并利用这个公式返回其质心:多边形质心。</p>
</blockquote>
<p><strong>参数</strong></p>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">类型</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left">geojson</td>
<td align="left">GeoJSON</td>
<td align="left">GeoJSON to be centered</td>
</tr>
<tr>
<td align="left">properties</td>
<td align="left">Object</td>
<td align="left">an Object that is used as the Feature ‘s properties</td>
</tr>
</tbody></table>
<p><strong>返回</strong></p>
<p>Feature <Point> - the center of mass</p>
<p><strong>示例</strong></p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs js"><span class="hljs-keyword">var</span> polygon = turf.<span class="hljs-title function_">polygon</span>([[[-<span class="hljs-number">81</span>, <span class="hljs-number">41</span>], [-<span class="hljs-number">88</span>, <span class="hljs-number">36</span>], [-<span class="hljs-number">84</span>, <span class="hljs-number">31</span>], [-<span class="hljs-number">80</span>, <span class="hljs-number">33</span>], [-<span class="hljs-number">77</span>, <span class="hljs-number">39</span>], [-<span class="hljs-number">81</span>, <span class="hljs-number">41</span>]]]);<br><br><span class="hljs-keyword">var</span> center = turf.<span class="hljs-title function_">centerOfMass</span>(polygon);<br></code></pre></td></tr></table></figure>

<p><code>npm install @turf/center-of-mass</code></p>
<p><img src="https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/6a7db45453f044f983729f314cba06d7~tplv-k3u1fbpfcp-watermark.image" srcset="/img/loading.gif" lazyload alt="image-20210531171328729.png"></p>
<h3 id="TRANSFORMATION"><a href="#TRANSFORMATION" class="headerlink" title="TRANSFORMATION"></a>TRANSFORMATION</h3><h4 id="buffer（计算缓冲区）"><a href="#buffer（计算缓冲区）" class="headerlink" title="buffer（计算缓冲区）"></a>buffer（计算缓冲区）</h4><blockquote>
<p>为给定半径的<code>Feature</code>计算一个缓冲区。支持的单位是英里、公里和度数。</p>
</blockquote>
<p><strong>参数</strong></p>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">类型</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left">geojson</td>
<td align="left">(FeatureCollection|Geometry|Feature )</td>
<td align="left">input to be buffered</td>
</tr>
<tr>
<td align="left">radius</td>
<td align="left">number</td>
<td align="left">distance to draw the buffer (negative values are allowed)</td>
</tr>
<tr>
<td align="left">options</td>
<td align="left">Object</td>
<td align="left">Optional parameters: see below</td>
</tr>
</tbody></table>
<p><strong>options选项</strong></p>
<table>
<thead>
<tr>
<th align="left">属性</th>
<th align="left">类型</th>
<th align="left">默认值</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left">units</td>
<td align="left">string</td>
<td align="left">kilometers</td>
<td align="left">any of the options supported by turf units</td>
</tr>
<tr>
<td align="left">steps</td>
<td align="left">number</td>
<td align="left">64</td>
<td align="left">number of steps</td>
</tr>
</tbody></table>
<p><strong>返回</strong></p>
<p>(FeatureCollection|Feature &lt;(Polygon|MultiPolygon)&gt;|undefined) - buffered features</p>
<p><strong>示例</strong></p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs js"><span class="hljs-keyword">var</span> point = turf.<span class="hljs-title function_">point</span>([-<span class="hljs-number">90.548630</span>, <span class="hljs-number">14.616599</span>]);<br><span class="hljs-keyword">var</span> buffered = turf.<span class="hljs-title function_">buffer</span>(point, <span class="hljs-number">500</span>, &#123;<span class="hljs-attr">units</span>: <span class="hljs-string">&#x27;miles&#x27;</span>&#125;);<br></code></pre></td></tr></table></figure>

<p><code>npm install @turf/buffer</code></p>
<p><img src="https://p9-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/a01bb688c6f74483a33a52aa505a5ec1~tplv-k3u1fbpfcp-watermark.image" srcset="/img/loading.gif" lazyload alt="image-20210531171448035.png"></p>
<h4 id="transformTranslate（平移）"><a href="#transformTranslate（平移）" class="headerlink" title="transformTranslate（平移）"></a>transformTranslate（平移）</h4><blockquote>
<p>在给定的方向角上沿沿恒向线移动指定距离的任何geojson<code>Feature</code>或几何图形。</p>
</blockquote>
<p><strong>参数</strong></p>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">类型</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left">geojson</td>
<td align="left">GeoJSON</td>
<td align="left">object to be translated</td>
</tr>
<tr>
<td align="left">distance</td>
<td align="left">number</td>
<td align="left">length of the motion; negative values determine motion in opposite direction</td>
</tr>
<tr>
<td align="left">direction</td>
<td align="left">number</td>
<td align="left">of the motion; angle from North in decimal degrees, positive clockwise</td>
</tr>
<tr>
<td align="left">options</td>
<td align="left">Object</td>
<td align="left">Optional parameters: see below</td>
</tr>
</tbody></table>
<p><strong>options选项</strong></p>
<table>
<thead>
<tr>
<th align="left">属性</th>
<th align="left">类型</th>
<th align="left">默认值</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left">units</td>
<td align="left">string</td>
<td align="left">kilometers</td>
<td align="left">in which</td>
</tr>
<tr>
<td align="left">zTranslation</td>
<td align="left">number</td>
<td align="left">0</td>
<td align="left">length of the vertical motion, same unit of distance</td>
</tr>
<tr>
<td align="left">mutate</td>
<td align="left">boolean</td>
<td align="left">false</td>
<td align="left">allows GeoJSON input to be mutated (significant performance increase if true)</td>
</tr>
</tbody></table>
<p><strong>返回</strong></p>
<p>GeoJSON - the translated GeoJSON object</p>
<p><strong>示例</strong></p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs js"><span class="hljs-keyword">var</span> poly = turf.<span class="hljs-title function_">polygon</span>([[[<span class="hljs-number">0</span>,<span class="hljs-number">29</span>],[<span class="hljs-number">3.5</span>,<span class="hljs-number">29</span>],[<span class="hljs-number">2.5</span>,<span class="hljs-number">32</span>],[<span class="hljs-number">0</span>,<span class="hljs-number">29</span>]]]);<br><span class="hljs-keyword">var</span> translatedPoly = turf.<span class="hljs-title function_">transformTranslate</span>(poly, <span class="hljs-number">100</span>, <span class="hljs-number">35</span>);<br></code></pre></td></tr></table></figure>

<p><code>npm install @turf/transform-translate</code></p>
<p><img src="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ea6705e11a7c4529a5fef7e5e1f09177~tplv-k3u1fbpfcp-watermark.image" srcset="/img/loading.gif" lazyload alt="image-20210531171535520.png"></p>
<h3 id="MISC"><a href="#MISC" class="headerlink" title="MISC"></a>MISC</h3><h4 id="lineIntersect（计算两端线段相交点）"><a href="#lineIntersect（计算两端线段相交点）" class="headerlink" title="lineIntersect（计算两端线段相交点）"></a>lineIntersect（计算两端线段相交点）</h4><blockquote>
<p>获取任何<code>LineString</code>或<code>Polygon</code>GeoJSON，并返回相交点。</p>
</blockquote>
<p><strong>参数</strong></p>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">类型</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left">line1</td>
<td align="left">(Geometry|FeatureCollection|Feature &lt;(LineString|MultiLineString|Polygon|MultiPolygon)&gt;)</td>
<td align="left">any LineString or Polygon</td>
</tr>
<tr>
<td align="left">line2</td>
<td align="left">(Geometry|FeatureCollection|Feature &lt;(LineString|MultiLineString|Polygon|MultiPolygon)&gt;)</td>
<td align="left">any LineString or Polygon</td>
</tr>
</tbody></table>
<p><strong>返回</strong></p>
<p>FeatureCollection <Point> - point(s) that intersect both</p>
<p><strong>示例</strong></p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs js"><span class="hljs-keyword">var</span> line1 = turf.<span class="hljs-title function_">lineString</span>([[<span class="hljs-number">126</span>, -<span class="hljs-number">11</span>], [<span class="hljs-number">129</span>, -<span class="hljs-number">21</span>]]);<span class="hljs-keyword">var</span> line2 = turf.<span class="hljs-title function_">lineString</span>([[<span class="hljs-number">123</span>, -<span class="hljs-number">18</span>], [<span class="hljs-number">131</span>, -<span class="hljs-number">14</span>]]);<span class="hljs-keyword">var</span> intersects = turf.<span class="hljs-title function_">lineIntersect</span>(line1, line2);<br></code></pre></td></tr></table></figure>

<p><code>npm install @turf/line-intersect</code></p>
<p><img src="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/5aab8d3e07a14080a2062f5c8f7b2700~tplv-k3u1fbpfcp-watermark.image" srcset="/img/loading.gif" lazyload alt="image-20210531171642600.png"></p>
<h4 id="mask-返回非遮罩多边形"><a href="#mask-返回非遮罩多边形" class="headerlink" title="mask(返回非遮罩多边形)"></a>mask(返回非遮罩多边形)</h4><blockquote>
<p>获取任意类型的多边形和一个可选的遮罩，并返回一个带孔的多边形外部环。</p>
</blockquote>
<p><strong>参数</strong></p>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">类型</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left">polygon</td>
<td align="left">(FeatureCollection|Feature &lt;(Polygon|MultiPolygon)&gt;)</td>
<td align="left">GeoJSON Polygon used as interior rings or holes.</td>
</tr>
<tr>
<td align="left">mask</td>
<td align="left">(Feature <Polygon>)</td>
<td align="left">GeoJSON Polygon used as the exterior ring (if undefined, the world extent is used)</td>
</tr>
</tbody></table>
<p><strong>返回</strong></p>
<p>Feature <Polygon> - Masked Polygon (exterior ring with holes).</p>
<p><strong>示例</strong></p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs js"><span class="hljs-keyword">var</span> polygon = turf.<span class="hljs-title function_">polygon</span>([[[<span class="hljs-number">112</span>, -<span class="hljs-number">21</span>], [<span class="hljs-number">116</span>, -<span class="hljs-number">36</span>], [<span class="hljs-number">146</span>, -<span class="hljs-number">39</span>], [<span class="hljs-number">153</span>, -<span class="hljs-number">24</span>], [<span class="hljs-number">133</span>, -<span class="hljs-number">10</span>], [<span class="hljs-number">112</span>, -<span class="hljs-number">21</span>]]]);<span class="hljs-keyword">var</span> mask = turf.<span class="hljs-title function_">polygon</span>([[[<span class="hljs-number">90</span>, -<span class="hljs-number">55</span>], [<span class="hljs-number">170</span>, -<span class="hljs-number">55</span>], [<span class="hljs-number">170</span>, <span class="hljs-number">10</span>], [<span class="hljs-number">90</span>, <span class="hljs-number">10</span>], [<span class="hljs-number">90</span>, -<span class="hljs-number">55</span>]]]);<span class="hljs-keyword">var</span> masked = turf.<span class="hljs-title function_">mask</span>(polygon, mask);<br></code></pre></td></tr></table></figure>

<p><code>npm install @turf/mask</code></p>
<p><img src="https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/285a8c794fb1488e810682ae96929526~tplv-k3u1fbpfcp-watermark.image" srcset="/img/loading.gif" lazyload alt="image-20210531171716436.png"></p>
<h3 id="JOINS"><a href="#JOINS" class="headerlink" title="JOINS"></a>JOINS</h3><h4 id="pointsWithinPolygon（返回在多边形内的点）"><a href="#pointsWithinPolygon（返回在多边形内的点）" class="headerlink" title="pointsWithinPolygon（返回在多边形内的点）"></a>pointsWithinPolygon（返回在多边形内的点）</h4><blockquote>
<p>找到落在(多个)多边形内的点。</p>
</blockquote>
<p><strong>参数</strong></p>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">类型</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left">points</td>
<td align="left">(Feauture|FeatureCollection <Point>)</td>
<td align="left">Points as input search</td>
</tr>
<tr>
<td align="left">polygons</td>
<td align="left">(FeatureCollection|Geometry|Feature &lt;(Polygon|MultiPolygon)&gt;)</td>
<td align="left">Points must be within these (Multi)Polygon(s)</td>
</tr>
</tbody></table>
<p><strong>返回</strong></p>
<p>FeatureCollection <Point> - points that land within at least one polygon</p>
<p><strong>示例</strong></p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs js"><span class="hljs-keyword">var</span> points = turf.<span class="hljs-title function_">points</span>([    [-<span class="hljs-number">46.6318</span>, -<span class="hljs-number">23.5523</span>],    [-<span class="hljs-number">46.6246</span>, -<span class="hljs-number">23.5325</span>],    [-<span class="hljs-number">46.6062</span>, -<span class="hljs-number">23.5513</span>],    [-<span class="hljs-number">46.663</span>, -<span class="hljs-number">23.554</span>],    [-<span class="hljs-number">46.643</span>, -<span class="hljs-number">23.557</span>]]);<span class="hljs-keyword">var</span> searchWithin = turf.<span class="hljs-title function_">polygon</span>([[    [-<span class="hljs-number">46.653</span>,-<span class="hljs-number">23.543</span>],    [-<span class="hljs-number">46.634</span>,-<span class="hljs-number">23.5346</span>],    [-<span class="hljs-number">46.613</span>,-<span class="hljs-number">23.543</span>],    [-<span class="hljs-number">46.614</span>,-<span class="hljs-number">23.559</span>],    [-<span class="hljs-number">46.631</span>,-<span class="hljs-number">23.567</span>],    [-<span class="hljs-number">46.653</span>,-<span class="hljs-number">23.560</span>],    [-<span class="hljs-number">46.653</span>,-<span class="hljs-number">23.543</span>]]]);<span class="hljs-keyword">var</span> ptsWithin = turf.<span class="hljs-title function_">pointsWithinPolygon</span>(points, searchWithin);<br></code></pre></td></tr></table></figure>

<p><code>npm install @turf/points-within-polygon</code></p>
<p><img src="https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/c98c804ab1c84b7a9393477adac8cf52~tplv-k3u1fbpfcp-watermark.image" srcset="/img/loading.gif" lazyload alt="image-20210531171955477.png"></p>
<h3 id="BOOLEANS"><a href="#BOOLEANS" class="headerlink" title="BOOLEANS"></a>BOOLEANS</h3><h4 id="booleanPointInPolygon（判断点是否在多边形内）"><a href="#booleanPointInPolygon（判断点是否在多边形内）" class="headerlink" title="booleanPointInPolygon（判断点是否在多边形内）"></a>booleanPointInPolygon（判断点是否在多边形内）</h4><blockquote>
<p>取一个点和一个多边形或多多边形，并确定该点是否位于该多边形内。多边形可以是凸的，也可以是凹的。</p>
</blockquote>
<figure class="highlight text"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs text">&gt; npm install @turf/boolean-point-in-polygon<br></code></pre></td></tr></table></figure>

<p><strong>参数</strong></p>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">类型</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left">point</td>
<td align="left">Coord</td>
<td align="left">input point</td>
</tr>
<tr>
<td align="left">polygon</td>
<td align="left">Feature &lt;(Polygon|MultiPolygon)&gt;</td>
<td align="left">input polygon or multipolygon</td>
</tr>
<tr>
<td align="left">options</td>
<td align="left">Object</td>
<td align="left">Optional parameters: see below</td>
</tr>
</tbody></table>
<p><strong>options选项</strong></p>
<table>
<thead>
<tr>
<th align="left">属性</th>
<th align="left">类型</th>
<th align="left">默认值</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left">ignoreBoundary</td>
<td align="left">boolean</td>
<td align="left">false</td>
<td align="left">True if polygon boundary should be ignored when determining if the point is inside the polygon otherwise false.</td>
</tr>
</tbody></table>
<p><strong>返回</strong></p>
<p>boolean - true if the Point is inside the Polygon; false if the Point is not inside the Polygon</p>
<p><strong>示例</strong></p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs js"><span class="hljs-keyword">var</span> pt = turf.<span class="hljs-title function_">point</span>([-<span class="hljs-number">77</span>, <span class="hljs-number">44</span>]);<span class="hljs-keyword">var</span> poly = turf.<span class="hljs-title function_">polygon</span>([[  [-<span class="hljs-number">81</span>, <span class="hljs-number">41</span>],  [-<span class="hljs-number">81</span>, <span class="hljs-number">47</span>],  [-<span class="hljs-number">72</span>, <span class="hljs-number">47</span>],  [-<span class="hljs-number">72</span>, <span class="hljs-number">41</span>],  [-<span class="hljs-number">81</span>, <span class="hljs-number">41</span>]]]);turf.<span class="hljs-title function_">booleanPointInPolygon</span>(pt, poly);<span class="hljs-comment">//= true</span><br></code></pre></td></tr></table></figure>

<h2 id="附录"><a href="#附录" class="headerlink" title="附录"></a>附录</h2><ul>
<li><p><a target="_blank" rel="noopener" href="http://turfjs.org/">官方文档</a></p>
</li>
<li><p><a target="_blank" rel="noopener" href="https://turfjs.fenxianglu.cn/">Turf.js中文网</a></p>
</li>
<li><p><a target="_blank" rel="noopener" href="https://www.mapbox.com/blog/turf-gis-for-web-maps/">Turf: GIS for web maps</a> （这个网页里有 mapbox.com 基于 Turf 开发的精美地图……的截图）</p>
</li>
</ul>

                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/categories/GIS/" class="category-chain-item">GIS</a>
  
  

      </span>
    
  
</span>

    </div>
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/tags/JavaScript/">#JavaScript</a>
      
        <a href="/tags/GIS/">#GIS</a>
      
    </div>
  
</div>


              
  

  <div class="license-box my-3">
    <div class="license-title">
      <div>Turf.js—让你在浏览器上实现地理分析</div>
      <div>https://moewang0321.github.io/2021/06/01/Turf.js—让你在浏览器上实现地理分析/</div>
    </div>
    <div class="license-meta">
      
        <div class="license-meta-item">
          <div>作者</div>
          <div>Moe Wang</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>发布于</div>
          <div>2021年6月1日</div>
        </div>
      
      
      
        <div class="license-meta-item">
          <div>许可协议</div>
          <div>
            
              
              
                <a target="_blank" href="https://creativecommons.org/licenses/by/4.0/">
                  <span class="hint--top hint--rounded" aria-label="BY - 署名">
                    <i class="iconfont icon-by"></i>
                  </span>
                </a>
              
            
          </div>
        </div>
      
    </div>
    <div class="license-icon iconfont"></div>
  </div>



              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2021/06/02/Cesium%E6%BA%90%E7%A0%81%E8%B7%9F%E8%AF%BB%E4%B9%8BCesiumWidget%E7%9A%84%E5%AE%9E%E7%8E%B0/" title="Cesium源码跟读之CesiumWidget的实现">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">Cesium源码跟读之CesiumWidget的实现</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2021/05/28/%E3%80%90%E4%B8%89%E7%BB%B4GIS%E5%8F%AF%E8%A7%86%E5%8C%96%E3%80%91%E9%85%B7%E7%82%AB%E8%87%AA%E5%AE%9A%E4%B9%89%E5%8A%A8%E6%80%81%E6%A0%87%E8%AE%B0%E4%BD%A0%E7%A1%AE%E5%AE%9A%E4%B8%8D%E6%83%B3%E5%AD%A6%E4%BC%9A%EF%BC%9F/" title="【三维GIS可视化】酷炫自定义动态标记你确定不想学会？">
                        <span class="hidden-mobile">【三维GIS可视化】酷炫自定义动态标记你确定不想学会？</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
  
  
    <article id="comments" lazyload>
      
    <div id="giscus" class="giscus"></div>
    <script type="text/javascript">
      Fluid.utils.loadComments('#giscus', function() {
        var options = {"repo":"moewang0321/moewang0321.github.io","repo-id":"MDEwOlJlcG9zaXRvcnkyMDEyNDI0NTY=","category":"Show and tell","category-id":"DIC_kwDOC_63WM4CUMsH","theme-light":"light_protanopia","theme-dark":"dark_dimmed","mapping":"pathname","reactions-enabled":1,"emit-metadata":1,"input-position":"top","loading":"lazy","lang":"zh-CN"};
        var attributes = {};
        for (let option in options) {
          if (!option.startsWith('theme-')) {
            var key = option.startsWith('data-') ? option : 'data-' + option;
            attributes[key] = options[option];
          }
        }
        var light = 'light_protanopia';
        var dark = 'dark_dimmed';
        window.GiscusThemeLight = light;
        window.GiscusThemeDark = dark;
        attributes['data-theme'] = document.documentElement.getAttribute('data-user-color-scheme') === 'dark' ? dark : light;
        for (let attribute in attributes) {
          var value = attributes[attribute];
          if (value === undefined || value === null || value === '') {
            delete attributes[attribute];
          }
        }
        var s = document.createElement('script');
        s.setAttribute('src', 'https://giscus.app/client.js');
        s.setAttribute('crossorigin', 'anonymous');
        for (let attribute in attributes) {
          s.setAttribute(attribute, attributes[attribute]);
        }
        var ss = document.getElementsByTagName('script');
        var e = ss.length > 0 ? ss[ss.length - 1] : document.head || document.documentElement;
        e.parentNode.insertBefore(s, e.nextSibling);
      });
    </script>
    <noscript>Please enable JavaScript to view the comments</noscript>


    </article>
  


          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="margin-left: -1rem">
    <div id="toc">
  <p class="toc-header">
    <i class="iconfont icon-list"></i>
    <span>目录</span>
  </p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>
  </div>
</div>





  



  



  



  



  







    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
       <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
    </div>
  
  
  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>




  
    <script  src="/js/img-lazyload.js" ></script>
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.18.2/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init(Object.assign({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      scrollSmooth    : true,
      includeTitleTags: true,
      headingsOffset  : -boardTop,
    }, CONFIG.toc));
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }

    Fluid.events.registerRefreshCallback(function() {
      if ('tocbot' in window) {
        tocbot.refresh();
        var toc = jQuery('#toc');
        if (toc.length === 0 || !tocbot) {
          return;
        }
        if (toc.find('.toc-list-item').length > 0) {
          toc.css('visibility', 'visible');
        }
      }
    });
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.11/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));

    Fluid.events.registerRefreshCallback(function() {
      if ('anchors' in window) {
        anchors.removeAll();
        var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
        var res = [];
        for (var item of el) {
          res.push('.markdown-body > ' + item.trim());
        }
        if (CONFIG.anchorjs.placement === 'left') {
          anchors.options.class = 'anchorjs-link-left';
        }
        anchors.add(res.join(', '));
      }
    });
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script  src="/js/local-search.js" ></script>





<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
